//下面是一个快排
function quickSort(arr) {
  if (arr.length <= 1) {
    return arr;
  }
  var left = [];
  var right = [];
  var mid = Math.floor(arr.length / 2);
  var midValue = arr.splice(mid, 1)[0];
  for (var i = 0; i < arr.length; i++) {
    if (arr[i] < midValue) {
      left.push(arr[i]);
    } else {
      right.push(arr[i]);
    }
  }
  return quickSort(left).concat(midValue, quickSort(right));
}
